package others;

/**
 * @author ycz
 * @date 2021/5/27
 * @description TODO
 *
 */
public class Singleton {

    private volatile static Singleton instance;

    public static Singleton getInstance() {
        if (instance == null) {
            synchronized (Singleton.class) {
                instance = new Singleton();
            }
        }
        return instance;
    }

    public static void main(String[] args) {
        Singleton.getInstance();
    }


}
